import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import pages from "~pages";
console.log(pages);
const routes: Array<RouteRecordRaw> = [
  ...pages,
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/applyAndDown",
    name: "applyAndDown",
    component: () =>
      import(/* webpackChunkName: "applyAndDown" */ "@/views/ApplyAndDown.vue"),
  },
  {
    path: "/guidePage",
    name: "guidePage",
    component: () =>
      import(/* webpackChunkName: "guidePage" */ "@/views/GuidePage.vue"),
  },
  {
    path: "/aiqian",
    name: "aiqian",
    component: () =>
      import(/* webpackChunkName: "aiqian" */ "@/views/Aiqian.vue"),
  },
  {
    path: "/userAgreement",
    name: "userAgreement",
    component: () =>
      import(
        /* webpackChunkName: "userAgreement" */ "@/views/UserAgreement.vue"
      ),
  },
  {
    path: "/privacyAgreement",
    name: "privacyAgreement",
    component: () =>
      import(
        /* webpackChunkName: "privacyAgreement" */ "@/views/PrivacyAgreement.vue"
      ),
  },
  {
    path: "/contract",
    name: "contract",
    component: () =>
      import(/* webpackChunkName: "contract" */ "@/views/Contract.vue"),
  },
  {
    path: "/privacyPolicyyp",
    name: "privacyPolicyyp",
    component: () =>
      import(
        /* webpackChunkName: "contract" */ "@/views/aggrementyp/PrivacyPolicy.vue"
      ),
  },
  {
    path: "/serviceAgreementyp",
    name: "serviceAgreementyp",
    component: () =>
      import(
        /* webpackChunkName: "contract" */ "@/views/aggrementyp/ServiceAgreement.vue"
      ),
  },
];

console.log("----", routes);
const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
